package com.shop.admin.dao.pink;

import com.shop.jpa.BaseDao;
import com.shop.domain.pink.StorePinkConfig;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface StorePinkConfigDao extends BaseDao<StorePinkConfig, Long> {

    //增加拼团次数
    @Modifying(clearAutomatically = true)
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @Query(nativeQuery = true,value = "update t_store_pink_config set kaituan_cishu =kaituan_cishu+1 where id = ?1")
    int AddPinkNum(Long pinkId);


}
